package com.aididi.jichu;


import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * @Auther: xuzexiang
 * @Date: 2018-11-2 0002 17:34
 * @Description:
 */
public class MathDemo {
    public static void main(String[] args) {
        System.out.println((int)(Math.random()*10));
        System.out.println(Math.pow(3,2));
        double a = 3/4;
        System.out.println(5/2);
        System.out.println(a);
        System.out.println(Math.abs(4/5));
        //四舍五入
        double d = 2.3464;
        BigDecimal bg = new BigDecimal(d).setScale(2, RoundingMode.UP);
        System.out.println(bg.doubleValue());
    }
}
